

//
//  XJHttpClass.m
//  XJMCustomer
//
//  Created by Mr.hu on 2017/10/9.
//  Copyright © 2017年 Mr.hu. All rights reserved.
//

#import "XJHttpClass.h"

@implementation XJHttpClass

#pragma mark--技师注册短信发送
+(void)Sendmessagenumber:(NSString *)sendmessage messagetype:(NSString *)messagetype andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:[NSString stringWithFormat:@"%@",sendmessage] forKey:@"0-account"];
    [request.agrs setObject:@(messagetype.integerValue) forKey:@"1-type"];
    //加密
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-account=%@&1-type=%@&signature=%@",sendmessage,messagetype,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Login/send_code";
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技技师注册step1
+(void)TeachRegisteraccount:(NSString *)account Pwd:(NSString *)password restpwd:(NSString *)re_pwd code_id:(NSString *)code_id code:(NSString *)code  version:(NSString *)version source:(NSString *)source andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:[NSString stringWithFormat:@"%@",account] forKey:@"0-account"];
    [request.agrs setObject:password forKey:@"1-pwd"];
    [request.agrs setObject:re_pwd forKey:@"2-re_pwd"];
    [request.agrs setObject:@(code_id.integerValue) forKey:@"3-code_id"];
    [request.agrs setObject:code forKey:@"4-code"];
    [request.agrs setObject:version forKey:@"5-version"];
    [request.agrs setObject:source forKey:@"6-source"];
    //加密
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-account=%@&1-pwd=%@&2-re_pwd=%@&3-code_id=%@&4-code=%@&5-version=%@&6-source=%@&signature=%@",account,password,re_pwd,code_id,code,version,source,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Techer/set_pwd";
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技师获取七牛upToken
+(void)ReceiveQiniuTokenFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    request.actionKey = @"Auth/qiniut";
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技师注册step2
+(void)TeachRegistertid:(NSString *)tid Second_account:(NSString *)account Pwd:(NSString *)pwd city:(NSString *)city truename:(NSString *)truename card:(NSString *)card sex:(NSString *)sex  birthday:(NSString *)birthday desc:(NSString *)desc idcard_zheng:(NSString *)idcard_zheng idcard_fan:(NSString *)idcard_fan  andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    
    [request.agrs setObject:tid forKey:@"a-tid"];
    [request.agrs setObject:[NSString stringWithFormat:@"%@",account] forKey:@"b-account"];
    
    [request.agrs setObject:city forKey:@"c-city"];
    [request.agrs setObject:truename forKey:@"d-truename"];
    [request.agrs setObject:card forKey:@"e-card"];
    [request.agrs setObject:sex forKey:@"f-sex"];
    [request.agrs setObject:birthday forKey:@"g-birthday"];
    [request.agrs setObject:desc forKey:@"h-desc"];
    [request.agrs setObject:idcard_zheng forKey:@"i-idcard_zheng"];
    [request.agrs setObject:idcard_fan forKey:@"j-idcard_fan"];
    
    //加密
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"a-tid=%@&b-account=%@&c-city=%@&d-truename=%@&e-card=%@&f-sex=%@&g-birthday=%@&h-desc=%@&i-idcard_zheng=%@&j-idcard_fan=%@&signature=%@",tid,account,city,truename,card,sex,birthday,desc,idcard_zheng,idcard_fan,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    
    NSLog(@"a-tid=%@&b-account=%@&c-city=%@&d-truename=%@e-card=%@&f-sex=%@&g-birthday=%@&h-desc=%@&i-idcard_zheng=%@&j-idcard_fan=%@&signature=%@",[XJToolClass getUserId],account,city,truename,card,sex,birthday,desc,idcard_zheng,idcard_fan,MDStr);
    
    request.actionKey = @"Login/doregister";
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技师注册step3设置支付密码
+(void)teachRegisterThreePayPwd:(NSString *)paypwd re_paypwd:(NSString *)re_paypwd andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    
    //从注册进来或者提现进来
    if ([TechSimple registerpass].User_TechID == nil || [TechSimple registerpass].User_TechID == NULL) {
        [request.agrs setObject:[XJToolClass getUserId] forKey:@"0-tid"];
    }else{
        [request.agrs setObject:[TechSimple registerpass].User_TechID forKey:@"0-tid"];
    }
    
    NSString * secondMd5 = [XJToolClass md5:paypwd];
    [request.agrs setObject:[NSString stringWithFormat:@"%@",secondMd5] forKey:@"1-paypwd"];
    NSString * repardmds = [XJToolClass md5:re_paypwd];
    [request.agrs setObject:repardmds forKey:@"2-re_paypwd"];
    
    if ([TechSimple registerpass].User_TechID == nil || [TechSimple registerpass].User_TechID == NULL) {
        NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-paypwd=%@&2-re_paypwd=%@&signature=%@",[XJToolClass getUserId],secondMd5,repardmds,PrivatyKeySecret]]];
        [request.agrs setObject:MDStr forKey:@"signature"];
    }else{
        NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-paypwd=%@&2-re_paypwd=%@&signature=%@",[TechSimple registerpass].User_TechID,secondMd5,repardmds,PrivatyKeySecret]]];
        [request.agrs setObject:MDStr forKey:@"signature"];
    }
    //加密
    
   
    request.actionKey = @"Techer/set_paypwd";
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}
#pragma mark--登录
+(void)LoginTechnicanPWd:(NSString *)PWD signature:(NSString *)account andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    
    [request.agrs setObject:account forKey:@"0-account"];
    NSString * pwdmd5 = [XJToolClass md5:PWD];
    [request.agrs setObject:pwdmd5 forKey:@"1-pwd"];
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-account=%@&1-pwd=%@&signature=%@",account,pwdmd5,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    
    NSLog(@"0-account=%@&1-pwd=%@&signature=%@",account,pwdmd5,MDStr);
    
    request.actionKey = @"Login/account_login";
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技师忘记密码
+(void)teachForgetSecretAccount:(NSString *)account new_pwd:(NSString *)new_pwd code_id:(NSString *)code_id code:(NSString *)code andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:account forKey:@"0-account"];
    NSString * pwdmd5 = [XJToolClass md5:new_pwd];
    [request.agrs setObject:pwdmd5 forKey:@"1-new_pwd"];
    if (code_id) {
        [request.agrs setObject:code_id forKey:@"2-code_id"];
    }
    [request.agrs setObject:code forKey:@"3-code"];
    
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-account=%@&1-new_pwd=%@&2-code_id=%@&3-code=%@&signature=%@",account,pwdmd5,code_id,code,PrivatyKeySecret]]];
    
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Login/doforgetpwd";
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技师修改头像
+(void)FixTeachHeadImageToken:(NSString *)token headurl:(NSString *)headurl andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
//    [request.agrs setObject:token forKey:@"1-token"];       //修改后去掉token
    
    
//    [TechSimple registerpass].User_TechID
     if ([TechSimple registerpass].User_TechID == nil || [TechSimple registerpass].User_TechID == NULL) {
         
         [request.agrs setObject:[XJToolClass getUserId] forKey:@"0-tid"];
         [request.agrs setObject:headurl forKey:@"1-headurl"];
         NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-headurl=%@&signature=%@",[XJToolClass getUserId], headurl,PrivatyKeySecret]]];
         [request.agrs setObject:MDStr forKey:@"signature"];
         
     }else{
         
         [request.agrs setObject:[TechSimple registerpass].User_TechID forKey:@"0-tid"];
         [request.agrs setObject:headurl forKey:@"1-headurl"];
         NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-headurl=%@&signature=%@",[TechSimple registerpass].User_TechID, headurl,PrivatyKeySecret]]];
         [request.agrs setObject:MDStr forKey:@"signature"];
         
     }
    
    
    request.actionKey = @"Techer/edit_headimg";
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技师修改昵称&简介  修改简介接口废弃
+(void)FixTeachNicknameProducttoken:(NSString *)token nickname:(NSString *)nickname desc:(NSString *)desc andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:token forKey:@"1-token"];
    NSString * MDStr = nil;
    
    if (nickname  && desc == nil) {
        [request.agrs setObject:nickname forKey:@"2-nickname"];
        MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-nickname=%@&signature=%@",[XJToolClass getUserId],token, nickname,PrivatyKeySecret]]];

        [XJToolClass removeAccount];
        [XJToolClass saveAccount:nickname];
    }
    
    if (desc && nickname == nil) {
        [request.agrs setObject:desc forKey:@"2-desc"];
        MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-desc=%@&signature=%@",[XJToolClass getUserId],token, desc,PrivatyKeySecret]]];
        
    }
    
    if (desc&& nickname) {
        [request.agrs setObject:nickname forKey:@"2-nickname"];
        [request.agrs setObject:desc forKey:@"3-desc"];
        MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-nickname=%@&3-desc=%@&signature=%@",[XJToolClass getUserId],token, nickname,desc,PrivatyKeySecret]]];
        
        [XJToolClass removeAccount];
        [XJToolClass saveAccount:nickname];
    }
    
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.access = YES;
    request.actionKey = @"Techer/edit_nickname";
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
    
}

#pragma mark--技师意见反馈
+(void)teachFeedBackToken:(NSString *)token type:(NSString *)type content:(NSString *)content andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:token forKey:@"1-token"];
    [request.agrs setObject:type forKey:@"2-type"];
    [request.agrs setObject:content forKey:@"3-content"];
    
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-type=%@&3-content=%@&signature=%@",[XJToolClass getUserId],token, type,content,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Techer/do_feedback";
    request.requestMethod = HTTP_POST_Request;
    request.access = YES;
    [request startWithBlock:finishblock];
}

#pragma mark--关于我们&客服中心
+(void)CustomerCenterInfoServer:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = @"http://api.xijiaomo.com/tech.php/v2/Notice/techer_about";
//    request.actionKey = @"";
    request.requestMethod = HTTP_GET_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技师个人中心
+(void)teachPersonCenterandFinishblockgetToken:(NSString *)Token andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:Token forKey:@"1-token"];
    
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&signature=%@",[XJToolClass getUserId],Token,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Techer/person_center";
    request.requestMethod = HTTP_POST_Request;
    request.access = YES;
    [request startWithBlock:finishblock];
}

#pragma mark--技师通知公告列表
+(void)noticeMessagepage:(NSString *)page andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:@(page.integerValue) forKey:@"1-page"];
    
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-page=%@&signature=%@",[XJToolClass getUserId],page,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Notice/msg";
    request.requestMethod = HTTP_POST_Request;
    request.access = YES;
    [request startWithBlock:finishblock];
}

#pragma mark--技师阅读公告消息
+(void)ReadnoticeMessagemsg_id:(NSString *)msg_id andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:msg_id forKey:@"1-msg_id"];
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-msg_id=%@&signature=%@",[XJToolClass getUserId],msg_id,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Notice/read_msg";
    request.requestMethod = HTTP_POST_Request;
    request.access = YES;
    [request startWithBlock:finishblock];
    
}
#pragma mark--技师注册step1检测手机号是否被使用
+(void)CheckPhoneUsersignature:(NSString *)signature andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    
    [request.agrs setObject:signature forKey:@"0-account"];
    request.actionKey = @"Login/reg_step1";
    
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-account=%@&signature=%@",signature,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--检测当前技师是否设置支付密码
+(void)checkPaySecrettoken:(NSString *)token andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:token forKey:@"1-token"];
    request.actionKey = @"Techer/check_set_paypwd";
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&signature=%@",[XJToolClass getUserId],token,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
    
}

#pragma mark--我的账户QA提现规则
+(void)myAccountRuleToken:(NSString *)token andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:token forKey:@"1-token"];
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&signature=%@",[XJToolClass getUserId],token,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Techer/myperson_qa";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技师账户明细
+(void)Techerincome_detailtoken:(NSString *)token page:(NSString *)page andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:token forKey:@"1-token"];
    [request.agrs setObject:page forKey:@"2-page"];
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-page=%@&signature=%@",[XJToolClass getUserId],token,page,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Techer/income_detail";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技师提现
+(void)Techeradd_cashtoken:(NSString *)token type:(NSString *)type cash_account:(NSString *)cash_account cash_money:(NSString *)cash_money paypwd:(NSString *)paypwd andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:token forKey:@"1-token"];
    [request.agrs setObject:type forKey:@"2-type"];
    [request.agrs setObject:cash_account forKey:@"3-cash_account"];
    [request.agrs setObject:cash_money forKey:@"4-cash_money"];
    NSString * md5double = [XJToolClass md5:paypwd];
    [request.agrs setObject:md5double forKey:@"5-paypwd"];
    
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-type=%@&3-cash_account=%@&4-cash_money=%@&5-paypwd=%@&signature=%@",[XJToolClass getUserId],token,type,cash_account,cash_money,md5double,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Techer/add_cash";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--获取技师所有评价
+(void)receiveTechCommenttoken:(NSString *)token page:(NSString *)page andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:token forKey:@"1-token"];
    if (page) {
        [request.agrs setObject:page forKey:@"2-page"];
        NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-page=%@&signature=%@",[XJToolClass getUserId],token,page,PrivatyKeySecret]]];
        [request.agrs setObject:MDStr forKey:@"signature"];
    }else{
        NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&signature=%@",[XJToolClass getUserId],token,PrivatyKeySecret]]];
        [request.agrs setObject:MDStr forKey:@"signature"];
    }
    request.actionKey = @"Techer/tech_comment";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
    
}

#pragma mark--技师上传照片、视频
+(void)teachUploadPhotoVideotoken:(NSString *)token type:(NSString *)type pics:(NSString *)pics videos:(NSString *)videos andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:token forKey:@"1-token"];
    [request.agrs setObject:type forKey:@"2-type"];
    
    if (pics) {
        [request.agrs setObject:pics forKey:@"3-pics"];
        NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-type=%@&3-pics=%@&signature=%@",[XJToolClass getUserId],token,type,pics,PrivatyKeySecret]]];
        [request.agrs setObject:MDStr forKey:@"signature"];
    }
    
    if (videos) {
        [request.agrs setObject:videos forKey:@"3-videos"];
        NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-type=%@&3-videos=%@&signature=%@",[XJToolClass getUserId],token,type,videos,PrivatyKeySecret]]];
        [request.agrs setObject:MDStr forKey:@"signature"];
    }
    
    if (videos && pics) {
        [request.agrs setObject:pics forKey:@"3-pics"];
        [request.agrs setObject:videos forKey:@"4-videos"];
        NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-type=%@&3-pics=%@&4-videos=%@&signature=%@",[XJToolClass getUserId],token,type,pics,videos,PrivatyKeySecret]]];
        [request.agrs setObject:MDStr forKey:@"signature"];
    }
    
    request.actionKey = @"Techer/uploadphoto";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技师抢单列表
+(void)teachReceiveOrderListToken:(NSString *)token t_lat:(NSString *)t_lat t_lon:(NSString *)t_lon page:(NSString *)page andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:token forKey:@"1-token"];
    [request.agrs setObject:t_lat forKey:@"2-t_lat"];
    [request.agrs setObject:t_lon forKey:@"3-t_lon"];
    [request.agrs setObject:page forKey:@"4-page"];
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-t_lat=%@&3-t_lon=%@&4-page=%@&signature=%@",[XJToolClass getUserId],token,t_lat,t_lon,page,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Order/get_area_order";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}
#pragma mark--修改技能
+(void)FixSkillToken:(NSString *)token skill:(NSString *)skill andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    
    if ([TechSimple registerpass].User_TechID == nil || [TechSimple registerpass].User_TechID == NULL) {
        
        [request.agrs setObject:[XJToolClass getUserId] forKey:@"0-tid"];
        [request.agrs setObject:skill forKey:@"1-skill"];
        NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-skill=%@&signature=%@",[XJToolClass getUserId],skill,PrivatyKeySecret]]];
        [request.agrs setObject:MDStr forKey:@"signature"];
        
        
    }else{
        
        [request.agrs setObject:[TechSimple registerpass].User_TechID forKey:@"0-tid"];
        [request.agrs setObject:skill forKey:@"1-skill"];
        NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-skill=%@&signature=%@",[TechSimple registerpass].User_TechID,skill,PrivatyKeySecret]]];
        [request.agrs setObject:MDStr forKey:@"signature"];
        
    }
    
    request.actionKey = @"Techer/edit_skill";
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--订单详情
+(void)OrderDetailOrder_id:(NSString *)Order_id token:(NSString *)token andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    if (Order_id) {
        [request.agrs setObject:Order_id forKey:@"1-order_id"];
    }
    [request.agrs setObject:token forKey:@"2-token"];
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-order_id=%@&2-token=%@&signature=%@",[XJToolClass getUserId],Order_id,token,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Order/order_info";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}
#pragma mark--订单列表
+(void)OrderListMineType:(NSString *)type page:(NSString *)page token:(NSString *)token andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    if (type) {
        [request.agrs setObject:type forKey:@"1-type"];
    }
    [request.agrs setObject:page forKey:@"2-page"];
    [request.agrs setObject:token forKey:@"3-token"];
    
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-type=%@&2-page=%@&3-token=%@&signature=%@",[XJToolClass getUserId],type,page,token,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Order/my_order_list";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}
#pragma mark--退款列表
+(void)ExitPayListToken:(NSString *)Token page:(NSString *)page andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    if (Token) {
        [request.agrs setObject:Token forKey:@"1-token"];
    }
    [request.agrs setObject:page forKey:@"2-page"];
    
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-page=%@&signature=%@",[XJToolClass getUserId],Token,page,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Order/refund_list";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}
#pragma mark--技能列表展示
+(void)TeachSkillListFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    
    request.host = HOST;
    if ([TechSimple registerpass].User_TechID == nil || [TechSimple registerpass].User_TechID == NULL || [TechSimple registerpass].User_TechID.length == 0) {
        [request.agrs setObject:[XJToolClass getUserId] forKey:@"0-tid"];
        NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&signature=%@",[XJToolClass getUserId],PrivatyKeySecret]]];
        [request.agrs setObject:MDStr forKey:@"signature"];
        
    }else{
        [request.agrs setObject:[TechSimple registerpass].User_TechID forKey:@"0-tid"];
        NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&signature=%@",[TechSimple registerpass].User_TechID,PrivatyKeySecret]]];
        [request.agrs setObject:MDStr forKey:@"signature"];
    }
    
    request.actionKey = @"Login/skill_list";
    
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技师点击开始服务
+(void)teachOnclickedStartServicetoken:(NSString *)token order_id:(NSString *)order_id andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    if (token) {
        [request.agrs setObject:token forKey:@"1-token"];
    }
    [request.agrs setObject:order_id forKey:@"2-order_id"];
    
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-order_id=%@&signature=%@",[XJToolClass getUserId],token,order_id,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Order/start_work";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}
#pragma mark--技师未完成订单提醒
+(void)TeachComplityOrderRemindToken:(NSString *)Token andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    if (Token) {
        [request.agrs setObject:Token forKey:@"1-token"];
    }
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&signature=%@",[XJToolClass getUserId],Token,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Order/no_finish_order";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}
#pragma mark--检测技师是否可以开始服务
+(void)TeachCheckStartServiceorder_id:(NSString *)order_id u_lon:(NSString *)u_lon u_lat:(NSString *)u_lat  token:(NSString *)token  andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    if (order_id) {
        [request.agrs setObject:order_id forKey:@"1-order_id"];
    }
    [request.agrs setObject:u_lon forKey:@"2-u_lon"];
    [request.agrs setObject:u_lat forKey:@"3-u_lat"];
    [request.agrs setObject:token forKey:@"4-token"];
    
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-order_id=%@&2-u_lon=%@&3-u_lat=%@&4-token=%@&signature=%@",[XJToolClass getUserId],order_id,u_lon,u_lat,token,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Order/location_range";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技师获取我的相册信息
+(void)TeachReceiveMineAlbumInformationToken:(NSString *)token andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    if (token) {
        [request.agrs setObject:token forKey:@"1-token"];
    }
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&signature=%@",[XJToolClass getUserId],token,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Techer/myphoto";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技师删除照片、视频
+(void)TeachDeleteMineAlbumInformationToken:(NSString *)token attch_id:(NSString *)attch_id andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    if (token) {
        [request.agrs setObject:token forKey:@"1-token"];
    }
    if (attch_id) {
        [request.agrs setObject:attch_id forKey:@"2-attch_id"];
    
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-attch_id=%@&signature=%@",[XJToolClass getUserId],token,attch_id,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Techer/delphoto";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
    }
}

#pragma mark--技师信息
+(void)TeachPersonalHomePageToken:(NSString *)token andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    if (token) {
        [request.agrs setObject:token forKey:@"1-token"];
    }
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&signature=%@",[XJToolClass getUserId],token,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Techer/tech_info";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}
#pragma mark--退款详情
+(void)ExitPayDetailToken:(NSString *)token refund_id:(NSString *)refund_id andFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    if (token) {
        [request.agrs setObject:token forKey:@"1-token"];
    }
     [request.agrs setObject:refund_id forKey:@"2-refund_id"];
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-refund_id=%@&signature=%@",[XJToolClass getUserId],token,refund_id,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Order/refund_info";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--技师同意&不同意退款操作
+(void)teachAgreeOrNotToken:(NSString *)token refund_id:(NSString *)refund_id  is_success:(NSString *)is_success andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:token forKey:@"1-token"];
    [request.agrs setObject:refund_id forKey:@"2-refund_id"];
    [request.agrs setObject:is_success forKey:@"3-is_success"]; //0同意，1不同意
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&2-refund_id=%@&3-is_success=%@&signature=%@",[XJToolClass getUserId],token,refund_id,is_success,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Order/teacher_refund";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--检查技师状态
+(void)CheckTechStatusToken:(NSString *)token andFinishblock:(requestResultBlock)finishblock{
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    [request.agrs setObject:token forKey:@"1-token"];
    NSString * MDStr =  [XJToolClass sha1:[XJToolClass md5:[NSString stringWithFormat:@"0-tid=%@&1-token=%@&signature=%@",[XJToolClass getUserId],token,PrivatyKeySecret]]];
    [request.agrs setObject:MDStr forKey:@"signature"];
    request.actionKey = @"Order/check_techer_status";
    request.access = YES;
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--邀请界面
+(void)InviteFriendSFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    //加密
    [request.agrs setObject:[XJToolClass getUserId] forKey:@"tid"];
    request.actionKey = @"Techer/techer_share_info";
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

#pragma mark--我的邀请列表
+(void)MyInviteFriendsListFinishblock:(requestResultBlock)finishblock{
    
    XJBaseRequest * request = [[XJBaseRequest alloc]init];
    request.host = HOST;
    //加密
    [request.agrs setObject:[XJToolClass getUserId] forKey:@"tid"];
    request.actionKey = @"Techer/techer_Invitation_list";
    request.requestMethod = HTTP_POST_Request;
    [request startWithBlock:finishblock];
}

@end
